<div class="judul"><?php echo anchor("/dropzone/", $title);?></div>
<script type="text/javascript">
    $(document).ready(function(){
        $("input[type=submit]").click(function(){
            if($('#nama').val() == ""){
                alert('Nama dropzone tidak boleh kosong');
                $('#nama').focus();
                return false;
            }
            else if($('#lokasi').val() == ""){
                alert('Nama lokasi tidak boleh kosong');
                $('#lokasi').focus();
                return false;
            }
            else if($('#penanggungJawab').val() == ""){
                alert('Nama penanggung jawab tidak boleh kosong');
                $('#penanggungJawab').focus();
                return false;
            }
            else if($('#noTelp').val() == ""){
                alert('No. Telepon tidak boleh kosong');
                $('#noTelp').focus();
                return false;
            }
        })        
    })
</script>
<?php
  $flashdata = $this->session->flashdata('message');
  $messages = isset ($flashdata)?pesan($flashdata):"";
  echo "$messages";
  $form = isset ($formView)?$formView:"";
  if($form != ""){
     $this->load->view("$form"); 
  }
?>  
<div class="data-list">
    <div class="floleft" style="margin: 8px 0">
        <?php
          echo addButton('dropzone/add_dropzone_form', 'tambah');
        ?>
    </div>    
    <table class="tabel" style="width: 100%">
        <th>No</th>
        <th>Nama</th>
        <th>Lokasi</th>
        <th>Penanggung Jawab</th>
        <th>No. Telepon</th>
        <th>Aksi</th>
        <?php
          $offsets = isset ($offset)?$offset:0;
          $no = 1 + $offsets;
          foreach ($listDropzone as $key => $row){
        ?>
        <tr class="<?php echo ($no%2)?"even":"odd";?>">
            <td align="center" style="width: 5%"><?php echo $no++;?></td>
            <td style="width: 20%"><?php echo $row['nama'];?></td>
            <td style="width: 30%"><?php echo $row['lokasi'];?></td>
            <td><?php echo $row['penanggung_jawab'];?></td>
            <td><?php echo $row['no_telp'];?></td>
            <td class="aksi" style="width: 15%">
                <?php
                  echo anchor('dropzone/edit_dropzone_form/'.$row['id'], 'edit', 'class=edit title="edit"');
                  echo anchor('dropzone/delete_dropzone/'.$row['id'],'hapus','class=delete title="edit" onClick="return confirm(\'Apakah anda benar-benar akah menghapus data ini\')"');
                ?>
            </td>
        </tr>
        <?php
          }
        ?>
    </table>
</div>
<?php
  echo "$pagination";
?>
